package com.sxhuayuan.parking.dao;

import com.sxhuayuan.parking.config.InvoiceStatus;
import com.sxhuayuan.parking.entity.Invoice;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;


/**
 * 发票记录
 * @author helong
 * @create 2019/8/29 15:23
 */
public interface InvoiceDao extends BaseDao<Invoice, Long>{
	@Query("select i from Invoice i where i.sn=?1")
	Invoice findBySn(String sn);

	@Query("select i from Invoice i where i.status=?1 and i.createDate>= ?2 and i.createDate <=?3")
	List<Invoice> findByStatusAndCreateDate(InvoiceStatus invoiceWait, Date startTime, Date endingTime);
}
